#!/bin/bash
# 清理未使用的导入

# App.tsx - 移除未使用的React导入(JSX自动运行时)
sed -i '/^import React from/d' src/App.tsx

# DataSourceForm.tsx - 移除未使用的Spin导入
sed -i 's/, Spin//' src/components/datasource/DataSourceForm.tsx

# useMetadata.ts - 移除未使用的queryClient导入
sed -i "s/import type { MetadataTable, MetadataColumn } from/import type { MetadataColumn } from/" src/hooks/useMetadata.ts
sed -i '93s/const { queryClient } = useQueryClient()/\/\/ Query client not needed for read-only operations/' src/hooks/useMetadata.ts

# collection.ts - 移除未使用的put, del导入
sed -i 's/import { get, post, put, del }/import { get, post }/' src/services/api/collection.ts

echo "Unused imports cleaned up"
